#
# @lc app=leetcode.cn id=1446 lang=python3
#
# [1446] 连续字符
#

# @lc code=start
class Solution:
    def maxPower(self, s: str) -> int:
        start = 0
        ret = 1
        for i in range(len(s)):
            if s[i] != s[start]:
                ret = max(ret, i - start)
                start = i
        ret = max(ret, i + 1 - start)
        return ret


if __name__ == "__main__":
    s = Solution()
    print(s.maxPower("abbcccddddeeeeedcba"), 5)
    print(s.maxPower("leetcode"), 2)
    print(s.maxPower("triplepillooooow"), 5)
    print(s.maxPower("hooraaaaaaaaaaay"), 11)
    print(s.maxPower("tourist"), 1)
    print(s.maxPower("cc"), 2)

# @lc code=end
